package com.atguigu.gmall.actvitiy.client;

import com.atguigu.gmall.activity.model.SeckillGoods;
import com.atguigu.gmall.actvitiy.client.impl.ActivityDegradeFeignClient;
import com.atguigu.gmall.common.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@FeignClient(value = "service-activity", path = "/api/activity/seckill", fallback = ActivityDegradeFeignClient.class)
public interface ActivityFeignClient {


    /**
     * 查询当日参与秒杀商品
     *
     * @return
     */
    @GetMapping("/findAll")
    public Result<List<SeckillGoods>> getSeckillGoods();


    /**
     * 查询秒杀商品详情
     *
     * @param skuId
     * @return
     */
    @GetMapping("/getSeckillGoods/{skuId}")
    public Result<SeckillGoods> getSecGoodsById(@PathVariable("skuId") Long skuId);


    /**
     * 汇总秒杀确认页面相关数据
     *
     * @param skuId
     * @return
     */
    @ApiOperation("汇总秒杀确认页面相关数据")
    @GetMapping("/auth/trade")
    public Result<Map> seckillTradeData(@RequestParam("skuId") Long skuId);
}
